home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / start_pes.z / start_pes
Encoding:
Text File  |  2002-10-03  |  4.5 KB  |  82 lines

  1.  
  2. START_PES(3)                                                   START_PES(3)
  3.  
  4.  
  5. NNNNAAAAMMMMEEEE
  6.      ssssttttaaaarrrrtttt____ppppeeeessss - Called at the beginning of a SHMEM program to identify the
  7.      number of processes desired
  8.  
  9. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  10.      C or C++:
  11.  
  12.         vvvvooooiiiidddd ssssttttaaaarrrrtttt____ppppeeeessss((((iiiinnnntttt _n_p_e_s))));;;;
  13.  
  14.      Fortran:
  15.  
  16.         CCCCAAAALLLLLLLL SSSSTTTTAAAARRRRTTTT____PPPPEEEESSSS((((_n_p_e_s))))
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      The ssssttttaaaarrrrtttt____ppppeeeessss routine identifies the number of processes for a
  20.      program.  This statement must be the first statement in a program that
  21.      uses distributed, shared memory (SHMEM) communication routines.  The
  22.      ssssttttaaaarrrrtttt____ppppeeeessss routine accepts the following argument:
  23.  
  24.      _n_p_e_s      Identifies the total number of processing elements (PEs)
  25.                desired.  If _n_p_e_s is 0, the number of PEs is selected by the
  26.                NNNNPPPPEEEESSSS environment variable.  The type of NNNNPPPPEEEESSSS is default
  27.                integer.
  28.  
  29.      If your parallel application uses MPI and SHMEM, you can omit the
  30.      ssssttttaaaarrrrtttt____ppppeeeessss call and call MMMMPPPPIIII____IIIInnnniiiitttt and MMMMPPPPIIII____FFFFiiiinnnnaaaalllliiiizzzzeeee, as specified in the
  31.      MPI standard, and launch the program with the mmmmppppiiiirrrruuuunnnn command.  Do not
  32.      call both MMMMPPPPIIII____iiiinnnniiiitttt and ssssttttaaaarrrrtttt____ppppeeeessss from the same program.
  33.  
  34.      Programs that use both SHMEM and MPI must call MMMMPPPPIIII____IIIInnnniiiitttt and
  35.      MMMMPPPPIIII____FFFFiiiinnnnaaaalllliiiizzzzeeee instead of ssssttttaaaarrrrtttt____ppppeeeessss.  PVM and SHMEM communication cannot
  36.      be used in the same program.
  37.  
  38.      For an overview of programming with SHMEM communication routines,
  39.      example SHMEM programs, and instructions for compiling SHMEM programs,
  40.      see the iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3) man page.
  41.  
  42. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  43.      This is a simple program that calls sssshhhhmmmmeeeemmmm____iiiinnnntttteeeeggggeeeerrrr____ppppuuuutttt(3):
  44.  
  45.         PROGRAM PUT
  46.  
  47.         INTEGER TARG, SRC, RECEIVER, BAR
  48.         COMMON /T/ TARG
  49.         PARAMETER (RECEIVER=1)
  50.         CALL START_PES(0)
  51.  
  52.         IF (MY_PE() .EQ. 0) THEN
  53.                 SRC = 33
  54.                 CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
  55.         ENDIF
  56.  
  57.         CALL SHMEM_BARRIER_ALL           ! SYNCHRONIZES SENDER AND RECEIVER
  58.  
  59.         IF (MY_PE() .EQ. RECEIVER) THEN
  60.                 CALL SHMEM_UDCFLUSH()    ! NEEDED ON CRAY T90 SYSTEMS
  61.                 PRINT*,'PE ', MY_PE(),' TARG=',TARG
  62.                 IF (TARG.NE.33) PRINT*,'FAIL'
  63.         ENDIF
  64.         END
  65.  
  66. NNNNOOOOTTTTEEEESSSS
  67.      If the ssssttttaaaarrrrtttt____ppppeeeessss call is not the first statement in a program,
  68.      unexpected results will occur.  Static data areas initialized prior to
  69.      the ssssttttaaaarrrrtttt____ppppeeeessss call will sometimes be set to zero during ssssttttaaaarrrrtttt____ppppeeeessss
  70.      processing.
  71.  
  72. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  73.      mmmmpppppppprrrruuuunnnn(1)
  74.  
  75.      ffffoooorrrrkkkk(2)
  76.  
  77.      iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3), sssshhhhmmmmeeeemmmm____bbbbaaaarrrrrrrriiiieeeerrrr(3), sssshhhhmmmmeeeemmmm____bbbbaaaarrrrrrrriiiieeeerrrr____aaaallllllll(3), sssshhhhmmmmeeeemmmm____ppppuuuutttt(3)
  78.  
  79.      mmmmyyyy____ppppeeee(3I), nnnnuuuummmm____ppppeeeessss(3I)
  80.  
  81.      _M_e_s_s_a_g_e _P_a_s_s_i_n_g _T_o_o_l_k_i_t: _M_P_I _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l
  82.